﻿@model List<Wedo.Recognition.Domain.Models.IPBankData>  
<div class="well" style="float: left; width: 98%;">
    @using (Html.BeginForm("ImportData", "BankData", FormMethod.Post, new { enctype = "multipart/form-data" }))
    {               
        @Html.DropDownList("ImportType", BindDropDownList.GetImportTypes(), "请选择")
        <input type="file" name="upload" />
        <button type="submit" class="btn btn-primary">
            上传</button>
        
        <div style="color: Red">
            请将汇丰银行文件另存为Office EXCEL 2007文件</div>
        if (Model != null && Model.Count > 0)
        {     
        <button type="button" class="btn btn-primary btn-large" onclick="SaveIPBankData()">
            确定保存</button>
        <button type="button" class="btn btn-large" onclick="CancelIPBankData()">
            取消保存</button>
        }
    }
    <div style="color: Red">@ViewData["ErrorMsg"]</div>
</div>
@if (Model != null && Model.Count > 0)
{
    @Html.Hidden("batchID", ViewData["Batch"])
    <div id="bankdata_privew_div">
        <h4 style="color: Red; margin-bottom: -1px;">
            背景黄色表示数据已经存在!</h4>
        <div>
            <table class="table">
                <thead>
                    <tr>
                        <th style="width: 80px">
                            到款时间
                        </th>
                        <th style="width: 80px">
                            银行
                        </th>
                        <th style="width: 80px">
                            收款类型
                        </th>
                        <th style="width: 100px">
                            收款人
                        </th>
                         
                        <th style="width: 50px">
                            币种
                        </th>
                        <th style="width: 80px">
                            实际收款
                        </th>
                        <th style="width: 80px">
                            银行手续费
                        </th>
                        <th>
                            交易附言
                        </th>
                        <th>
                            交易附言2
                        </th>
                        <th>
                            银行备注
                        </th>
                        <th style="width: 70px">
                        </th>
                    </tr>
                </thead>
                <tbody id="importData">
                    @foreach (var item in Model)
                    {
                        string styles = item.HasExists ? "background-color:yellow" : "";
                        <tr style="@styles">
                            <td>@Html.DisplayFor(m => item.ReceiveDate)
                            </td>
                            <td>@BindDropDownList.GetBankName(item.BankCode)
                            </td>
                            <td>@BindDropDownList.GetReceiveTypeName(item.ReceiveType)
                            </td>
                            <td>@item.Payer
                            </td>
                            <td>@item.Currency
                            </td>
                            <td>@Html.DisplayFor(m => item.BankPaidIn)
                            </td>
                            <td>@Html.DisplayFor(m => item.BankServiceFee)
                            </td>
                            <td>@Html.DisplayFor(m => item.LCNumber)
                            </td>
                            <td>@Html.DisplayFor(m => item.TradeAddionalComment)
                            </td>
                            <td>@Html.DisplayFor(m => item.BankRemarkNum)
                            </td>
                            <td>@Html.ShortcutLink("删除", "DeleteIP", new { item.Id }, call: "DeleteTr")
                            </td>
                        </tr>
                    }
                </tbody>
            </table>
        </div>
    </div>
}